﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Sunny;
using System.IO;
namespace ALL_Tool
{
    public partial class LoginForm : Sunny.UI.UIForm
    {
        public LoginForm()
        {
            InitializeComponent();        
        }     
        //打开程序 加载完成之后  设置焦点在 username
        private void LoginForm_Load(object sender, EventArgs e)
        {
            this.BeginInvoke((Action)delegate
            {
                Username.Focus();
            });
        }
        //输入0812点击登录按钮  进入主程序
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string username = Username.Text;
            //string password = Password.Text;
            //if (username == "demo" && password == "0812")
            if (username == "0812")
            {
                // 登录成功，打开Form1
                this.Hide(); // 隐藏当前登录窗口
                FCustomMain mainForm = new FCustomMain();
                mainForm.ShowDialog();
                this.Close(); // 关闭登录窗口
            }
            else
            {
                // 显示错误信息
                MessageBox.Show("密码错误,请重试！");
            }
            
        }

        private void Username_TextChanged(object sender, EventArgs e)
        {

        }

        private void uiLine1_Click(object sender, EventArgs e)
        {

        }

        private void LoginForm_Load_1(object sender, EventArgs e)
        {

        }
    }
}
